import React, { useEffect, useState } from 'react'
import NewsPublish from '../../../comopnents/publish-manage/NewsPublish'
import usePublish from '../../../comopnents/publish-manage/usePublish'
import { Button } from 'antd'

export default function Published() {

  const { dataSource,handlePublish } = usePublish(2)
  return (
    <div>
      <NewsPublish
        dataSource={dataSource}
        // 这里按钮就是把它当成一个属性，然后再共用组件里面用props.button去接收
        button={(id)=><Button type="primary" onClick={()=>handlePublish(id)}>下线</Button>}
      ></NewsPublish>
    </div>
  )
}
